package com.itheima.io.bufferedinputstream.demo01;

import java.io.*;

public class BufferedInputStreamDemo01 {

    public static void main(String[] args) throws IOException {

        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream("itheima-io-bufferedinputstream\\a.text"));

//        int by = -1;
//        while ((by = bufferedInputStream.read()) != -1){
//            System.out.print((char)by);
//        }

        byte[] bytes = new byte[1024];
        int len = -1;
        while ((len = bufferedInputStream.read(bytes)) != -1){
            System.out.println(new String(bytes, 0, len));
        }

        bufferedInputStream.close();

    }
}
